package com.beverages.messages.client;

import com.beverages.messages.common.Result;
import com.beverages.messages.config.FeignOkHttpConfig;
import com.beverages.messages.entity.dto.HoldersDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "merchant-holder-service", url = "${merchant.holder.service.url}", configuration = FeignOkHttpConfig.class)
public interface MerchantHolderClient {

    @GetMapping("/merchant/holder/prepared")
    Result<List<HoldersDTO>> getBeveragesWhichAreBeingPrepared();

    @GetMapping("/merchant/holder/full/{holderId}")
    Result updateFullHolder(@PathVariable("holderId") Integer holderId);

    @PostMapping("/merchant/holder/pick-up")
    Result updateHoldersFromWhichBeverageWasJustTaken(@RequestBody List<Integer> holderIds);

    @GetMapping("/merchant/holder/preset")
    Result presetPreparedOrders();

    @GetMapping("/merchant/holder/processing/{holderId}")
    Result setOneProcessingBeverage(@PathVariable("holderId") Integer holderId);
}
